Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'only_transfers_as_changes' option to synchronize module #57885

Closed
wants to merge 4 commits into from
Closed

add 'only_transfers_as_changes' option to synchronize module #57885

wants to merge 4 commits into from

Conversation

RustyDust
Copy link

SUMMARY

This change adds a new option 'only_transfers_as_changes' to the synchronize module.

Rationale
When managing configurations to be deployed with ansible in git the time stamps of the files aren't preserved. When working with a distributed team this means time stamps of config files are always local to the member's computers. This together with the usage of the synchronize module often results in ansible detecting changes where there actually aren't any and in consequence unnecessary restarts of services at deploy time - often services the person wasn't even working on.

This PR adds a new boolean option 'only_transfers_as_changes' to the synchronize module that does the following:

  • enforces the 'checksum' mode on rsync
  • sets the 'changed' flag with in the module solely depending on real transfers TO the destination (as indicated by the '<' flag in rsync's response)

While setting the 'checksum' option may have an impact on synchronize's performance this should be negligible considering the main use would be for relatively small text files.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

sychronize

ADDITIONAL INFORMATION

@ansibot
Copy link
Contributor

ansibot commented Jun 15, 2019

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

The test ansible-test sanity --test ansible-doc --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

The test ansible-test sanity --test ansible-doc --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

The test ansible-test sanity --test ansible-doc --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

The test ansible-test sanity --test ansible-doc --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

The test ansible-test sanity --test ansible-doc --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:458:7: E111 indentation is not a multiple of four

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

lib/ansible/modules/files/synchronize.py:0:0: E305 DOCUMENTATION.options.only_transfers_as_changes.description.1: expected str @ data['options']['only_transfers_as_changes']['description'][1]. Got {'sets "checksum': 'yes"'}
lib/ansible/modules/files/synchronize.py:0:0: E309 version_added for new option (only_transfers_as_changes) should be '2.9'. Currently StrictVersion ('0.0')
lib/ansible/modules/files/synchronize.py:0:0: E325 Argument 'only_transfers_as_changes' in argument_spec defines type as <class 'bool'> but documentation defines type as 'bool'

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jun 15, 2019

cc @tima
click here for bot help

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 ci_verified Changes made in this PR are causing tests to fail. feature This issue/PR relates to a feature request. files Files category module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. performance support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jun 15, 2019
@ansibot
Copy link
Contributor

ansibot commented Jun 15, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:457:7: E111 indentation is not a multiple of four

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: E309 version_added for new option (only_transfers_as_changes) should be '2.9'. Currently StrictVersion ('0.0')

click here for bot help

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jun 15, 2019
@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Jun 18, 2019
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jun 26, 2019
@RustyDust RustyDust closed this Nov 7, 2019
@RustyDust RustyDust reopened this Nov 7, 2019
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Nov 7, 2019
@ansibot
Copy link
Contributor

ansibot commented Nov 7, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: option-incorrect-version-added: version_added for new option (only_transfers_as_changes) should be '2.10'. Currently StrictVersion ('2.9')

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Nov 7, 2019
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Nov 8, 2019
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Nov 8, 2019
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Nov 16, 2019
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Mar 31, 2020
@ansibot ansibot added collection Related to Ansible Collections work collection:ansible.posix needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 29, 2020
@ansibot
Copy link
Contributor

ansibot commented Aug 16, 2020

Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.

For further information, please see:
https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md

@ansibot ansibot closed this Aug 16, 2020
@ansible ansible locked and limited conversation to collaborators Sep 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bot_closed collection:ansible.posix collection Related to Ansible Collections work feature This issue/PR relates to a feature request. files Files category module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. performance stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants